<?php
/**
 * Created by DreamPHP.
 * Auth : Leruge
 * Email : leruge@163.cm
 * Date : 2018/01/29 19:31
 * Url : Http://www.shangjinclub.cn/
 */

namespace app\common\validate;

use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'username|用户名' => 'require|min:4|max:10',
        'password|密码' => 'require|min:4|max:10',
        'verify|验证码' => 'require|captcha'
    ];

    public function sceneEdit()
    {
        return $this->only(['username','password', 'conpass'])
            ->append('username', ['unique:admin'])
            ->append('conpass|确认密码', ['require', 'confirm:password']);
    }
}
